home *** CD-ROM | disk | FTP | other *** search
/ TestDrive Windows 1993 Fall / TestDrive Windows 1993 Fall.iso / dbase / samples / barcount.prg < prev    next >
Encoding:
Text File  |  1993-03-09  |  1.6 KB  |  46 lines

  1. PROCEDURE BarCount
  2. *--------------------------------------------------------------------
  3. * DESCRIPTION
  4. *   BarCount demonstrates the use of the new BARCOUNT() function
  5. *   and the ON POPUP command.
  6. *--------------------------------------------------------------------
  7.   PRIVATE nBarCount
  8.   SET TALK OFF
  9.   SET COLOR TO W+/B
  10.   SET STATUS OFF
  11.  
  12.   DEFINE WINDOW BarStat FROM 6, 20 TO 10, 78 DOUBLE
  13.   ACTIVATE WINDOW BarStat
  14.   @ 0,2 SAY "Popup status for: "
  15.   @ 1,2 SAY "  On bar:     of"
  16.   @ 2,2 SAY "  Prompt:"
  17.   ACTIVATE SCREEN
  18.  
  19.   DEFINE POPUP FilePick FROM 3,5 PROMPT FILES LIKE *.dbf
  20.   nBarCount = BARCOUNT( "FILEPICK" )    && Get the initial count of bars
  21.   ON POPUP FilePick DO BarStat          && Display popup info during navigation
  22.   ACTIVATE POPUP FilePick
  23.   RELEASE WINDOW BarStat
  24.   RELEASE POPUP FilePick
  25. RETURN
  26. *-- EOP: BarCount
  27.  
  28. PROCEDURE BarStat
  29. *--------------------------------------------------------------------
  30. * DESCRIPTION
  31. *   BarStat is called using the ON POPUP command to display the
  32. *   bar information as the user moves the cursor in the popup.
  33. *--------------------------------------------------------------------
  34.   ACTIVATE WINDOW BarStat
  35.   @ 0,20 SAY POPUP()                    && Display popup name
  36.   @ 1,12 SAY STR( BAR(), 3 )            && Display current bar number
  37.   @ 1,19 SAY STR( nBarCount, 3 )        && Display total number of bars
  38.   @ 2,12                                && Clear out the previous bar prompt
  39.   @ 2,12 SAY LEFT( PROMPT(),35 )        && Display the current bar prompt
  40.   ACTIVATE SCREEN
  41. RETURN
  42. *-- EOP: BarStat
  43.  
  44.  
  45.  
  46.